<html><head><title>InitializeMacroCommand()</title><link href="styles/default.css" type="text/css" rel="stylesheet"/></head><body><div class="header"> </div><br class="clear"/><div class="navigation"><ul><li><a href="index.htm">Documentation</a></li></ul><ul><li><a class="" href="4294967296-PureMVC.Patterns.Command.htm">PureMVC.Patterns.Command</a><ul><li><a class="" href="4294967469.htm">MacroCommand</a><ul><li><a class="" href="4294967469-Methods.htm">Methods</a><ul><li><a class="current" href="4294967471.htm">InitializeMacroCommand</a><ul/></li></ul></li></ul></li></ul></li></ul></div><div class="content"><h1>InitializeMacroCommand() Method</h1><div class="summary">Initialize the <span class="code">MacroCommand</span>. </div><div class="details"><span class="namespace"><em>Namespace:</em> <a href="4294967296-PureMVC.Patterns.Command.htm">PureMVC.Patterns.Command</a></span><span class="assembly"><em>Assembly:</em> PureMVC in (PureMVC.dll)
								</span></div>
        <div class="syntax">
            <h2>Syntax</h2>
            <pre><span class="keyword">protected</span> <span class="keyword">void</span> InitializeMacroCommand()</pre>
        </div>
    <div class="remarks"><h2>Remarks</h2><p>In your subclass, override this method to  initialize the <span class="code">MacroCommand</span>'s SubCommand  list with <span class="code">ICommand</span> class references like this: </p>
        <pre class="code">override void InitializeMacroCommand() 
{
    AddSubCommand(() =&gt; new com.me.myapp.controller.FirstCommand());
    AddSubCommand(() =&gt; new com.me.myapp.controller.SecondCommand());
    AddSubCommand(() =&gt; new com.me.myapp.controller.ThirdCommand());
}</pre>
    <p>Note that SubCommands may be any <span class="code">ICommand</span> implementor, <span class="code">MacroCommand</span>s or <span class="code">SimpleCommands</span> are both acceptable. </p></div></div><div class="footer">
			Produced by the <a href="http://theboxsoftware.com/products/live-documenter/">Live Documenter</a> developed by <a href="http://theboxsoftware.com">The Box Software</a>.
		</div></body></html>